Skip to content

Шульпин Илья. Лабораторная работа 2: LLVM. Вариант 3. #147

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 21, 2025

Conversation

NeeMiyuki
Copy link

@NeeMiyuki NeeMiyuki commented May 13, 2025

Этот пасс выполняет следующую задачу:

  • Проходит по всем функциям модуля (кроме самой @add).
  • Ищет бинарные операции add i32.
  • Если в модуле присутствует функция @add(i32, i32) (ровно два параметра одинакового типа), то каждую такую инструкцию add i32 заменяет на вызов call i32 @add(i32, i32), сохраняя семантику (операнды и имя результата).
  • Использует llvm::make_early_inc_range для безопасного удаления исходных инструкций во время итерации.
  • Если функции @add нет или её сигнатура не соответствует требуемой, инструкции add i32 остаются без изменений.

@NeeMiyuki NeeMiyuki requested review from m-ly4 and aobolensk May 20, 2025 22:43
@m-ly4 m-ly4 added this pull request to the merge queue May 21, 2025
Merged via the queue into NN-complr-tech:course-spring-2025 with commit ffdaac4 May 21, 2025
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants